;;; init-c++.el --- Description -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2023 gotpl
;;
;; Author: gotpl <631707329@qq.com>
;; Maintainer: gotpl <631707329@qq.com>
;; Created: 2023-09-08 15:08:33
;; Modified: 2024-02-22 11:40:38
;; Package-Requires: ((emacs "24.3"))
;;
;; This file is not part of GNU Emacs.
;;
;;; Commentary:
;;
;;  Description
;;
;;; Code:

;; (defun my-indent-style()
;;   "Override the built-in BSD indentation style with some additional rules"                                                             
;;   `(;; Here are your custom rules
;;     ((node-is ")") parent-bol 0)                                                                                                         
;;     ((match nil "argument_list" nil 1 1) parent-bol c-ts-mode-indent-offset)                                                                                   
;;     ((parent-is "argument_list") prev-sibling 0)                                                                                         
;;     ((match nil "parameter_list" nil 1 1) parent-bol c-ts-mode-indent-offset)
;;     ((parent-is "parameter_list") prev-sibling 0) 

;;     ;; Append here the indent style you want as base                                                                                       
;;    ,@(alist-get 'bsd (c-ts-mode--indent-styles 'cpp)))) 
;; emacs29
;; (use-package c-ts-mode
;;  :ensure nil                                                                                                                     
;;  :if (treesit-language-available-p 'c)                                                                                                
;;  :custom                                                                                                                              
;;  (c-ts-mode-indent-offset 4)                                                                                                          
;;  (c-ts-mode-indent-style #'my-indent-style)                                                                                           
;;  :init                                                                                                                                          
;;  ;; Remap the standard C/C++ modes                                                                                                        
;;  (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))                                                                          
;;  (add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode))                                                                      
;;  (add-to-list 'major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode)))
(setq c-basic-offset 4)
(setq c-ts-mode-indent-offset 4)

;; (with-eval-after-load 'dap-mode
;;   (require 'dap-cpptools))

;; (with-eval-after-load 'realgud
;;     (defun projectile-run-realgud-gdb ()
;;     "Invoke `gdb' in the project's root."
;;     (interactive)
;;     (projectile-with-default-dir (projectile-acquire-root)
;;         (call-interactively 'realgud:gdb)))
;;   )

(provide 'init-c++)
;;; init-c++.el ends here
